pulse-dashboard
Version:
A Next.js Dashboard application for real-time monitoring and historical analysis of Playwright test executions. This component provides the UI for visualizing Playwright test results and can be run as a standalone CLI tool.
1 lines • 34 kB
JavaScript
(()=>{var e={};e.id=847,e.ids=[847],e.modules={409:(e,t,s)=>{Promise.resolve().then(s.bind(s,13136))},3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},13136:(e,t,s)=>{"use strict";s.d(t,{TestDetailsClientPage:()=>eV});var a=s(60687),r=s(65773),n=s(48661),l=s(44493),i=s(29523),o=s(43210),d=s(70569),c=s(11273),h=s(9510),u=s(98599),m=s(96963),x=s(14163),p=s(13495),f=s(65551),g=s(43),v="rovingFocusGroup.onEntryFocus",j={bubbles:!1,cancelable:!0},b="RovingFocusGroup",[N,y,w]=(0,h.N)(b),[k,A]=(0,c.A)(b,[w]),[T,M]=k(b),F=o.forwardRef((e,t)=>(0,a.jsx)(N.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,a.jsx)(N.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,a.jsx)(C,{...e,ref:t})})}));F.displayName=b;var C=o.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:s,orientation:r,loop:n=!1,dir:l,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:h,onEntryFocus:m,preventScrollOnEntryFocus:b=!1,...N}=e,w=o.useRef(null),k=(0,u.s)(t,w),A=(0,g.jH)(l),[M=null,F]=(0,f.i)({prop:i,defaultProp:c,onChange:h}),[C,D]=o.useState(!1),L=(0,p.c)(m),P=y(s),I=o.useRef(!1),[E,R]=o.useState(0);return o.useEffect(()=>{let e=w.current;if(e)return e.addEventListener(v,L),()=>e.removeEventListener(v,L)},[L]),(0,a.jsx)(T,{scope:s,orientation:r,dir:A,loop:n,currentTabStopId:M,onItemFocus:o.useCallback(e=>F(e),[F]),onItemShiftTab:o.useCallback(()=>D(!0),[]),onFocusableItemAdd:o.useCallback(()=>R(e=>e+1),[]),onFocusableItemRemove:o.useCallback(()=>R(e=>e-1),[]),children:(0,a.jsx)(x.sG.div,{tabIndex:C||0===E?-1:0,"data-orientation":r,...N,ref:k,style:{outline:"none",...e.style},onMouseDown:(0,d.m)(e.onMouseDown,()=>{I.current=!0}),onFocus:(0,d.m)(e.onFocus,e=>{let t=!I.current;if(e.target===e.currentTarget&&t&&!C){let t=new CustomEvent(v,j);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=P().filter(e=>e.focusable);S([e.find(e=>e.active),e.find(e=>e.id===M),...e].filter(Boolean).map(e=>e.ref.current),b)}}I.current=!1}),onBlur:(0,d.m)(e.onBlur,()=>D(!1))})})}),D="RovingFocusGroupItem",L=o.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:s,focusable:r=!0,active:n=!1,tabStopId:l,...i}=e,c=(0,m.B)(),h=l||c,u=M(D,s),p=u.currentTabStopId===h,f=y(s),{onFocusableItemAdd:g,onFocusableItemRemove:v}=u;return o.useEffect(()=>{if(r)return g(),()=>v()},[r,g,v]),(0,a.jsx)(N.ItemSlot,{scope:s,id:h,focusable:r,active:n,children:(0,a.jsx)(x.sG.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...i,ref:t,onMouseDown:(0,d.m)(e.onMouseDown,e=>{r?u.onItemFocus(h):e.preventDefault()}),onFocus:(0,d.m)(e.onFocus,()=>u.onItemFocus(h)),onKeyDown:(0,d.m)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=function(e,t,s){var a;let r=(a=e.key,"rtl"!==s?a:"ArrowLeft"===a?"ArrowRight":"ArrowRight"===a?"ArrowLeft":a);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(r))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)))return P[r]}(e,u.orientation,u.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let s=f().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)s.reverse();else if("prev"===t||"next"===t){"prev"===t&&s.reverse();let a=s.indexOf(e.currentTarget);s=u.loop?function(e,t){return e.map((s,a)=>e[(t+a)%e.length])}(s,a+1):s.slice(a+1)}setTimeout(()=>S(s))}})})})});L.displayName=D;var P={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function S(e,t=!1){let s=document.activeElement;for(let a of e)if(a===s||(a.focus({preventScroll:t}),document.activeElement!==s))return}var I=s(46059),E="Tabs",[R,$]=(0,c.A)(E,[A]),_=A(),[z,H]=R(E),O=o.forwardRef((e,t)=>{let{__scopeTabs:s,value:r,onValueChange:n,defaultValue:l,orientation:i="horizontal",dir:o,activationMode:d="automatic",...c}=e,h=(0,g.jH)(o),[u,p]=(0,f.i)({prop:r,onChange:n,defaultProp:l});return(0,a.jsx)(z,{scope:s,baseId:(0,m.B)(),value:u,onValueChange:p,orientation:i,dir:h,activationMode:d,children:(0,a.jsx)(x.sG.div,{dir:h,"data-orientation":i,...c,ref:t})})});O.displayName=E;var V="TabsList",q=o.forwardRef((e,t)=>{let{__scopeTabs:s,loop:r=!0,...n}=e,l=H(V,s),i=_(s);return(0,a.jsx)(F,{asChild:!0,...i,orientation:l.orientation,dir:l.dir,loop:r,children:(0,a.jsx)(x.sG.div,{role:"tablist","aria-orientation":l.orientation,...n,ref:t})})});q.displayName=V;var G="TabsTrigger",K=o.forwardRef((e,t)=>{let{__scopeTabs:s,value:r,disabled:n=!1,...l}=e,i=H(G,s),o=_(s),c=U(i.baseId,r),h=W(i.baseId,r),u=r===i.value;return(0,a.jsx)(L,{asChild:!0,...o,focusable:!n,active:u,children:(0,a.jsx)(x.sG.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":h,"data-state":u?"active":"inactive","data-disabled":n?"":void 0,disabled:n,id:c,...l,ref:t,onMouseDown:(0,d.m)(e.onMouseDown,e=>{n||0!==e.button||!1!==e.ctrlKey?e.preventDefault():i.onValueChange(r)}),onKeyDown:(0,d.m)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&i.onValueChange(r)}),onFocus:(0,d.m)(e.onFocus,()=>{let e="manual"!==i.activationMode;u||n||!e||i.onValueChange(r)})})})});K.displayName=G;var B="TabsContent",X=o.forwardRef((e,t)=>{let{__scopeTabs:s,value:r,forceMount:n,children:l,...i}=e,d=H(B,s),c=U(d.baseId,r),h=W(d.baseId,r),u=r===d.value,m=o.useRef(u);return o.useEffect(()=>{let e=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,a.jsx)(I.C,{present:n||u,children:({present:s})=>(0,a.jsx)(x.sG.div,{"data-state":u?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":c,hidden:!s,id:h,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:s&&l})})});function U(e,t){return`${e}-trigger-${t}`}function W(e,t){return`${e}-content-${t}`}X.displayName=B;var Z=s(4780);let J=o.forwardRef(({className:e,...t},s)=>(0,a.jsx)(q,{ref:s,className:(0,Z.cn)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));J.displayName=q.displayName;let Q=o.forwardRef(({className:e,...t},s)=>(0,a.jsx)(K,{ref:s,className:(0,Z.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Q.displayName=K.displayName;let Y=o.forwardRef(({className:e,...t},s)=>(0,a.jsx)(X,{ref:s,className:(0,Z.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Y.displayName=X.displayName;var ee=s(85726),et=s(91821),es=s(42692),ea=s(38765),er=s(97025),en=s(72963),el=s(15036),ei=s(99196),eo=s(82614);let ed=(0,eo.A)("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]),ec=(0,eo.A)("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),eh=(0,eo.A)("FileJson",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);var eu=s(50069);let em=(0,eo.A)("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]),ex=(0,eo.A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),ep=(0,eo.A)("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),ef=(0,eo.A)("Film",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]]),eg=(0,eo.A)("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]),ev=(0,eo.A)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);var ej=s(36260);let eb=(0,eo.A)("ChartLine",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);var eN=s(30474),ey=s(96834),ew=s(70137);let ek=(0,eo.A)("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);function eA({status:e}){switch("string"==typeof e?e.toLowerCase():""){case"passed":return(0,a.jsx)(ea.A,{className:"h-4 w-4 text-green-500 flex-shrink-0"});case"failed":return(0,a.jsx)(er.A,{className:"h-4 w-4 text-destructive flex-shrink-0"});case"skipped":return(0,a.jsx)(en.A,{className:"h-4 w-4 text-accent flex-shrink-0"});case"timedout":return(0,a.jsx)(el.A,{className:"h-4 w-4 text-destructive flex-shrink-0"});case"pending":return(0,a.jsx)(el.A,{className:"h-4 w-4 text-primary animate-pulse flex-shrink-0"});default:return(0,a.jsx)(ei.A,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"})}}function eT({step:e,level:t=0}){var s;let r=e.steps&&e.steps.length>0,n=(0,a.jsxs)("div",{className:`flex flex-col space-y-2 ${t>0?"pl-4 border-l border-muted ml-2":""}`,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between space-x-2",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2 min-w-0",children:[(0,a.jsx)(eA,{status:e.status}),(0,a.jsx)("span",{className:"text-sm font-medium text-foreground truncate",title:e.title,children:e.title}),e.isHook&&(0,a.jsx)(ey.E,{variant:"outline",className:"text-xs px-1.5 py-0.5",children:e.hookType||"hook"})]}),(0,a.jsx)("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:(s=e.duration)<1e3?`${s}ms`:`${(s/1e3).toFixed(2)}s`})]}),e.codeLocation&&(0,a.jsxs)("div",{className:"flex items-center text-xs text-muted-foreground space-x-1 pl-6",children:[(0,a.jsx)(ek,{className:"h-3 w-3"}),(0,a.jsx)("span",{children:e.codeLocation})]}),e.errorMessage&&(0,a.jsxs)("div",{className:"pl-6 mt-1",children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-destructive mb-0.5",children:"Error:"}),(0,a.jsx)("pre",{className:"bg-destructive/10 text-xs p-2 rounded-md whitespace-pre-wrap break-all font-code max-h-32 overflow-y-auto",children:(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:(0,Z.c)(e.errorMessage)}})})]})]});return r?(0,a.jsx)(ew.nD,{type:"single",collapsible:!0,className:"w-full py-1",children:(0,a.jsxs)(ew.As,{value:`step-${e.id}`,className:"border-none",children:[(0,a.jsx)(ew.$m,{className:"p-1 hover:no-underline hover:bg-muted/50 rounded-md text-left [&[data-state=open]>svg]:rotate-90",children:n}),(0,a.jsx)(ew.ub,{className:"pt-0 pb-0",children:(0,a.jsx)("div",{className:"mt-1",children:e.steps.map(e=>(0,a.jsx)(eT,{step:e,level:t+1},e.id))})})]})}):(0,a.jsx)("div",{className:"py-2 px-1 hover:bg-muted/50 rounded-md",children:n})}var eM=s(6475);eM.callServer,eM.findSourceMapURL;var eF=s(48482),eC=s(61678),eD=s(85168),eL=s(27747),eP=s(9920),eS=s(38246),eI=s(57359),eE=s(50326);let eR=e=>{let{cx:t,cy:s,payload:r}=e;if(!t||!s||!r)return null;let n="hsl(var(--muted-foreground))";return"passed"===r.status?n="hsl(var(--chart-3))":"failed"===r.status||"timedOut"===r.status?n="hsl(var(--destructive))":"skipped"===r.status&&(n="hsl(var(--accent))"),(0,a.jsx)("circle",{cx:t,cy:s,r:5,fill:n,stroke:"hsl(var(--card))",strokeWidth:1})},e$=({active:e,payload:t,label:s})=>{if(e&&t&&t.length){let e=t[0].payload;return(0,a.jsxs)("div",{className:"bg-card p-3 border border-border rounded-md shadow-lg",children:[(0,a.jsx)("p",{className:"label text-sm font-semibold text-foreground",children:`Date: ${new Date(e.date).toLocaleDateString()}`}),(0,a.jsx)("p",{className:"text-xs text-foreground",children:`Duration: ${ez(e.duration)}`}),(0,a.jsx)("p",{className:"text-xs",style:{color:"passed"===e.status?"hsl(var(--chart-3))":"failed"===e.status||"timedOut"===e.status?"hsl(var(--destructive))":"hsl(var(--accent))"},children:`Status: ${e.status}`})]})}return null};function e_({status:e}){switch(e){case"passed":return(0,a.jsx)(ea.A,{className:"h-6 w-6 text-[hsl(var(--chart-3))]"});case"failed":return(0,a.jsx)(er.A,{className:"h-6 w-6 text-destructive"});case"skipped":return(0,a.jsx)(en.A,{className:"h-6 w-6 text-[hsl(var(--accent))]"});case"timedOut":return(0,a.jsx)(el.A,{className:"h-6 w-6 text-destructive"});case"pending":return(0,a.jsx)(el.A,{className:"h-6 w-6 text-primary animate-pulse"});default:return(0,a.jsx)(ei.A,{className:"h-6 w-6 text-muted-foreground"})}}function ez(e){if(e<1e3)return`${e}ms`;let t=parseFloat((e/1e3).toFixed(2));if(t<60)return`${t}s`;let s=Math.floor(t/60),a=parseFloat((t%60).toFixed(2));return`${s}m ${a}s`}function eH({contentType:e}){let t=e.toLowerCase();return t.includes("html")?(0,a.jsx)(ed,{className:"h-6 w-6 text-blue-500"}):t.includes("pdf")?(0,a.jsx)(ec,{className:"h-6 w-6 text-red-500"}):t.includes("json")?(0,a.jsx)(eh,{className:"h-6 w-6 text-yellow-500"}):t.includes("csv")||t.startsWith("text/plain")?(0,a.jsx)(eu.A,{className:"h-6 w-6 text-green-500"}):t.startsWith("text/")?(0,a.jsx)(ec,{className:"h-6 w-6 text-gray-500"}):(0,a.jsx)(em,{className:"h-6 w-6 text-gray-400"})}function eO(e,t="Attachment"){return e&&"string"==typeof e&&e.split(/[/\\]/).pop()||t}function eV({testId:e}){let t=(0,r.useRouter)(),{currentRun:s,loadingCurrent:d,errorCurrent:c}=(0,n.O)(),[h,u]=(0,o.useState)(null),[m,x]=(0,o.useState)([]),[p,f]=(0,o.useState)(!0),[g,v]=(0,o.useState)(null),j=(0,o.useRef)(null),b=(0,o.useMemo)(()=>h&&h.screenshots&&Array.isArray(h.screenshots)?h.screenshots.map((e,t)=>({name:eO(e,`Screenshot ${t+1}`),path:e,contentType:"image/png","data-ai-hint":`screenshot ${t+1}`})):[],[h]),N=(0,o.useMemo)(()=>h&&h.videoPath&&Array.isArray(h.videoPath)?h.videoPath.map((e,t)=>"string"!=typeof e?(console.warn(`Invalid video path element at index ${t}:`,e),{name:`Invalid Video ${t+1}`,path:"#",contentType:"video/mp4","data-ai-hint":"invalid video"}):{name:eO(e,`Video ${t+1}`),path:e,contentType:"video/mp4","data-ai-hint":`video ${t+1}`}):[],[h]),y=(0,o.useMemo)(()=>h&&h.tracePath&&"string"==typeof h.tracePath?{name:eO(h.tracePath,"trace.zip"),path:h.tracePath,contentType:"application/zip"}:null,[h]),w=(0,o.useMemo)(()=>h&&h.attachments&&Array.isArray(h.attachments)?h.attachments.map((e,t)=>({name:e.name||eO(e.path,`Attachment ${t+1}`),path:e.path,contentType:e.contentType||"application/octet-stream","data-ai-hint":e["data-ai-hint"]})):[],[h]),k=(0,o.useMemo)(()=>w.filter(e=>e.contentType.toLowerCase().includes("html")),[w]),A=(0,o.useMemo)(()=>w.filter(e=>e.contentType.toLowerCase().includes("pdf")),[w]),T=(0,o.useMemo)(()=>w.filter(e=>e.contentType.toLowerCase().includes("json")),[w]),M=(0,o.useMemo)(()=>w.filter(e=>e.contentType.toLowerCase().startsWith("text/")),[w]),F=(0,o.useMemo)(()=>w.filter(e=>!k.includes(e)&&!A.includes(e)&&!T.includes(e)&&!M.includes(e)),[w,k,A,T,M]),C=(0,o.useMemo)(()=>b.length+N.length+ +!!y+w.length,[b,N,y,w]);if(d&&!h)return(0,a.jsxs)("div",{className:"container mx-auto py-8 space-y-6",children:[(0,a.jsx)(ee.E,{className:"h-10 w-48 mb-4 rounded-md"}),(0,a.jsxs)(l.Zp,{className:"shadow-xl rounded-lg",children:[(0,a.jsxs)(l.aR,{children:[(0,a.jsx)(ee.E,{className:"h-8 w-3/4 mb-2 rounded-md"}),(0,a.jsx)(ee.E,{className:"h-4 w-1/2 rounded-md"})]}),(0,a.jsxs)(l.Wu,{className:"space-y-4",children:[(0,a.jsx)(ee.E,{className:"h-10 w-1/3 mb-4 rounded-md"}),(0,a.jsx)(ee.E,{className:"h-40 w-full rounded-md"})]})]})]});if(c&&!h)return(0,a.jsxs)("div",{className:"container mx-auto px-4 py-8",children:[(0,a.jsxs)(et.Fc,{variant:"destructive",className:"rounded-lg",children:[(0,a.jsx)(et.XL,{children:"Error loading test data"}),(0,a.jsx)(et.TN,{children:c})]}),(0,a.jsxs)(i.$,{onClick:()=>t.push("/"),variant:"outline",className:"mt-4 rounded-lg",children:[(0,a.jsx)(ex,{className:"mr-2 h-4 w-4"})," Back"]})]});if(!h)return(0,a.jsxs)("div",{className:"container mx-auto px-4 py-8 text-center",children:[(0,a.jsxs)(et.Fc,{className:"rounded-lg",children:[(0,a.jsx)(et.XL,{children:"Test Not Found"}),(0,a.jsxs)(et.TN,{children:["The test with ID '",e,"' could not be found in the current report."]})]}),(0,a.jsxs)(i.$,{onClick:()=>t.push("/"),variant:"outline",className:"mt-6 rounded-lg",children:[(0,a.jsx)(ex,{className:"mr-2 h-4 w-4"})," Back to Dashboard"]})]});let D=function(e){if(!e)return"";let t=e.split(" > ");return t[t.length-1]||e}(h.name);return(0,a.jsxs)("div",{className:"container mx-auto px-4 py-8 space-y-6",children:[(0,a.jsxs)(i.$,{onClick:()=>t.push("/"),variant:"outline",size:"sm",className:"mb-6 rounded-lg",children:[(0,a.jsx)(ex,{className:"mr-2 h-4 w-4"})," Back to Dashboard"]}),(0,a.jsxs)(l.Zp,{className:"shadow-xl rounded-lg",children:[(0,a.jsx)(l.aR,{children:(0,a.jsxs)("div",{className:"flex items-start justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)(l.ZB,{className:"text-2xl font-headline text-primary flex items-center",title:h.name,children:[(0,a.jsx)(e_,{status:h.status}),(0,a.jsx)("span",{className:"ml-3",children:D})]}),h.suiteName&&(0,a.jsxs)(l.BT,{className:"mt-1 text-md",children:["From suite: ",h.suiteName]}),(0,a.jsxs)("p",{className:"text-sm text-muted-foreground mt-2",children:["Latest Run Date: ",d?(0,a.jsx)("span",{className:"text-muted-foreground",children:"Loading..."}):s?.run?.timestamp?(0,a.jsx)("span",{className:"font-medium",children:new Date(s.run.timestamp).toLocaleString()}):c&&!s?.run?.timestamp?(0,a.jsx)("span",{className:"text-destructive font-medium",children:"Error loading date"}):(0,a.jsx)("span",{className:"font-medium",children:"Not available"})]}),(0,a.jsxs)("div",{className:"mt-1 text-xs text-muted-foreground",children:[(0,a.jsxs)("p",{children:["ID: ",h.id]}),h.browser&&(0,a.jsxs)("p",{children:["Browser: ",h.browser]}),h.codeSnippet&&(0,a.jsxs)("p",{children:["Defined at: ",h.codeSnippet]})]})]}),(0,a.jsxs)("div",{className:"text-right flex-shrink-0",children:[(0,a.jsx)(ey.E,{variant:"outline",className:"capitalize text-sm px-3 py-1 rounded-full border",style:function(e){switch(e){case"passed":return{backgroundColor:"hsl(var(--chart-3))",color:"hsl(var(--primary-foreground))"};case"failed":case"timedOut":return{backgroundColor:"hsl(var(--destructive))",color:"hsl(var(--destructive-foreground))"};case"skipped":return{backgroundColor:"hsl(var(--accent))",color:"hsl(var(--accent-foreground))"};case"pending":return{backgroundColor:"hsl(var(--primary))",color:"hsl(var(--primary-foreground))"};default:return{backgroundColor:"hsl(var(--muted))",color:"hsl(var(--muted-foreground))"}}}(h.status),children:h.status}),(0,a.jsxs)("p",{className:"text-sm text-muted-foreground mt-1",children:["Duration: ",ez(h.duration)]}),(0,a.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Retries: ",h.retries]}),h.tags&&h.tags.length>0&&(0,a.jsx)("div",{className:"mt-1 space-x-1",children:h.tags.map(e=>(0,a.jsx)(ey.E,{variant:"secondary",className:"text-xs rounded-full",children:e},e))})]})]})}),(0,a.jsx)(l.Wu,{children:(0,a.jsxs)(O,{defaultValue:"steps",className:"w-full",children:[(0,a.jsxs)(J,{className:"grid w-full grid-cols-2 md:grid-cols-4 mb-4 rounded-lg",children:[(0,a.jsxs)(Q,{value:"steps",children:["Execution Steps (",h.steps?.length||0,")"]}),(0,a.jsxs)(Q,{value:"attachments",children:["Attachments (",C,")"]}),(0,a.jsxs)(Q,{value:"logs",children:[(0,a.jsx)(ec,{className:"h-4 w-4 mr-2"}),"Logs"]}),(0,a.jsx)(Q,{value:"history",children:"Test Run History"})]}),(0,a.jsxs)(Y,{value:"steps",className:"mt-4 p-1 md:p-4 border rounded-lg bg-card shadow-inner",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-foreground mb-3 px-3 md:px-0",children:"Test Execution Steps"}),h.errorMessage&&(0,a.jsxs)("div",{className:"mb-4 p-3 md:p-0",children:[(0,a.jsx)("h4",{className:"font-semibold text-md text-destructive mb-1",children:"Overall Test Error:"}),(0,a.jsx)("pre",{className:"bg-destructive/10 text-sm p-4 rounded-lg whitespace-pre-wrap break-all font-code overflow-x-auto",children:(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:(0,Z.c)(h.errorMessage)}})})]}),h.steps&&h.steps.length>0?(0,a.jsx)(es.F,{className:"h-[600px] w-full",children:(0,a.jsx)("div",{className:"pr-4",children:h.steps.map((e,t)=>(0,a.jsx)(eT,{step:e},e.id||t))})}):(0,a.jsx)("p",{className:"text-muted-foreground p-3 md:p-0",children:"No detailed execution steps available for this test."})]}),(0,a.jsx)(Y,{value:"attachments",className:"mt-4 p-1 md:p-4 border rounded-lg bg-card shadow-inner",children:(0,a.jsxs)(O,{defaultValue:"sub-screenshots",className:"w-full",children:[(0,a.jsx)(es.F,{className:"w-full whitespace-nowrap rounded-lg",children:(0,a.jsxs)(J,{className:"inline-grid w-max grid-flow-col mb-4 rounded-lg",children:[(0,a.jsxs)(Q,{value:"sub-screenshots",disabled:0===b.length,children:[(0,a.jsx)(ep,{className:"h-4 w-4 mr-2"}),"Screenshots (",b.length,")"]}),(0,a.jsxs)(Q,{value:"sub-video",disabled:0===N.length,children:[(0,a.jsx)(ef,{className:"h-4 w-4 mr-2"}),"Videos (",N.length,")"]}),(0,a.jsxs)(Q,{value:"sub-trace",disabled:!y,children:[(0,a.jsx)(eg,{className:"h-4 w-4 mr-2"}),"Trace ",y?"(1)":"(0)"]}),(0,a.jsxs)(Q,{value:"sub-html",disabled:0===k.length,children:[(0,a.jsx)(ed,{className:"h-4 w-4 mr-2"}),"HTML (",k.length,")"]}),(0,a.jsxs)(Q,{value:"sub-pdf",disabled:0===A.length,children:[(0,a.jsx)(ec,{className:"h-4 w-4 mr-2"}),"PDF (",A.length,")"]}),(0,a.jsxs)(Q,{value:"sub-json",disabled:0===T.length,children:[(0,a.jsx)(eh,{className:"h-4 w-4 mr-2"}),"JSON (",T.length,")"]}),(0,a.jsxs)(Q,{value:"sub-text",disabled:0===M.length,children:[(0,a.jsx)(ec,{className:"h-4 w-4 mr-2"}),"Text/CSV (",M.length,")"]}),(0,a.jsxs)(Q,{value:"sub-other",disabled:0===F.length,children:[(0,a.jsx)(em,{className:"h-4 w-4 mr-2"}),"Others (",F.length,")"]})]})}),(0,a.jsxs)(Y,{value:"sub-screenshots",className:"mt-4",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-foreground mb-4",children:"Screenshots"}),b.length>0?(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:b.map((e,t)=>{let s=(0,Z.O)(e.path);return"#"===s?null:(0,a.jsxs)("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"relative aspect-video rounded-lg overflow-hidden group border hover:border-primary transition-all shadow-md hover:shadow-lg",children:[(0,a.jsx)(eN.default,{src:s,alt:e.name||`Screenshot ${t+1}`,fill:!0,style:{objectFit:"cover"},className:"group-hover:scale-105 transition-transform duration-300","data-ai-hint":e["data-ai-hint"]||"test screenshot"}),(0,a.jsx)("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-center justify-center p-2",children:(0,a.jsx)("p",{className:"text-white text-xs text-center break-all",children:e.name||`Screenshot ${t+1}`})})]},`img-preview-${t}`)})}):(0,a.jsx)("p",{className:"text-muted-foreground",children:"No screenshots available for this test."})]}),(0,a.jsxs)(Y,{value:"sub-video",className:"mt-4",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-foreground mb-4",children:"Video Recording(s)"}),(0,a.jsx)("div",{className:"space-y-4",children:N.length>0?N.map((e,t)=>(0,a.jsxs)("div",{className:"p-4 border rounded-lg bg-muted/30 shadow-sm flex items-center justify-between",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-foreground truncate",title:e.name,children:e.name}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i.$,{asChild:!0,variant:"ghost",size:"sm",children:(0,a.jsx)("a",{href:(0,Z.O)(e.path),target:"_blank",rel:"noopener noreferrer",children:"View"})}),(0,a.jsx)(i.$,{asChild:!0,variant:"outline",size:"sm",children:(0,a.jsxs)("a",{href:(0,Z.O)(e.path),download:e.name,children:[(0,a.jsx)(ev,{className:"h-4 w-4 mr-2"}),"Download"]})})]})]},`video-${t}`)):(0,a.jsxs)(et.Fc,{className:"rounded-lg",children:[(0,a.jsx)(ei.A,{className:"h-4 w-4"}),(0,a.jsx)(et.XL,{children:"No Videos Available"}),(0,a.jsx)(et.TN,{children:"There is no video recording associated with this test run."})]})})]}),(0,a.jsxs)(Y,{value:"sub-trace",className:"mt-4",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-foreground mb-4",children:"Trace File"}),y?(0,a.jsxs)("div",{className:"p-4 border rounded-lg bg-muted/30 space-y-3 shadow-sm",children:[(0,a.jsxs)("a",{href:(0,Z.O)(y.path),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-primary hover:underline text-base",download:y.name,children:[(0,a.jsx)(ev,{className:"h-5 w-5 mr-2"})," Download Trace File (",y.name,")"]}),(0,a.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Path: ",y.path]}),(0,a.jsxs)(et.Fc,{className:"rounded-lg",children:[(0,a.jsx)(ei.A,{className:"h-4 w-4"}),(0,a.jsx)(et.XL,{children:"Using Trace Files"}),(0,a.jsxs)(et.TN,{children:["Trace files (.zip) can be viewed using the Playwright CLI: ",(0,a.jsx)("code",{className:"bg-muted px-1 py-0.5 rounded-sm",children:"npx playwright show-trace /path/to/your/trace.zip"}),". Or by uploading them to ",(0,a.jsx)("a",{href:"https://trace.playwright.dev/",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"trace.playwright.dev"}),"."]})]})]}):(0,a.jsxs)(et.Fc,{className:"rounded-lg",children:[(0,a.jsx)(ei.A,{className:"h-4 w-4"}),(0,a.jsx)(et.XL,{children:"No Trace File Available"}),(0,a.jsx)(et.TN,{children:"There is no Playwright trace file associated with this test run."})]})]}),[{value:"sub-html",title:"HTML Files",attachments:k},{value:"sub-pdf",title:"PDF Documents",attachments:A},{value:"sub-json",title:"JSON Files",attachments:T},{value:"sub-text",title:"Text & CSV Files",attachments:M},{value:"sub-other",title:"Other Files",attachments:F}].map(e=>(0,a.jsxs)(Y,{value:e.value,className:"mt-4",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-foreground mb-4",children:e.title}),(0,a.jsx)("div",{className:"space-y-3",children:e.attachments.length>0?e.attachments.map((e,t)=>(0,a.jsxs)("div",{className:"p-3 border rounded-lg bg-muted/30 shadow-sm flex items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 truncate",children:[(0,a.jsx)(eH,{contentType:e.contentType}),(0,a.jsxs)("div",{className:"truncate",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-foreground truncate",title:e.name,children:e.name}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:e.contentType})]})]}),(0,a.jsxs)("div",{className:"flex items-center flex-shrink-0 gap-2",children:[(0,a.jsx)(i.$,{asChild:!0,variant:"ghost",size:"sm",children:(0,a.jsx)("a",{href:(0,Z.O)(e.path),target:"_blank",rel:"noopener noreferrer",children:"View"})}),(0,a.jsx)(i.$,{asChild:!0,variant:"outline",size:"sm",children:(0,a.jsxs)("a",{href:(0,Z.O)(e.path),download:e.name,children:[(0,a.jsx)(ev,{className:"h-4 w-4 mr-2"}),"Download"]})})]})]},t)):(0,a.jsxs)(et.Fc,{className:"rounded-lg",children:[(0,a.jsx)(ei.A,{className:"h-4 w-4"}),(0,a.jsx)(et.XL,{children:"No Files Available"}),(0,a.jsx)(et.TN,{children:"No attachments of this type were found for this test."})]})})]},e.value))]})}),(0,a.jsxs)(Y,{value:"logs",className:"mt-4 p-4 border rounded-lg bg-card space-y-6 shadow-inner",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:"text-lg font-semibold text-foreground mb-3 flex items-center",children:[(0,a.jsx)(ej.A,{className:"h-5 w-5 mr-2 text-primary"}),"Console Logs / Standard Output"]}),(0,a.jsx)(es.F,{className:"h-48 w-full rounded-lg border p-3 bg-muted/30 shadow-sm",children:(0,a.jsx)("pre",{className:"text-sm whitespace-pre-wrap break-words font-code",children:(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:(0,Z.c)(h.stdout&&Array.isArray(h.stdout)&&h.stdout.length>0?h.stdout.join("\n"):"No standard output logs captured for this test.")}})})})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:"text-lg font-semibold text-foreground mb-3 flex items-center",children:[(0,a.jsx)(en.A,{className:"h-5 w-5 mr-2 text-destructive"}),"Error Messages / Standard Error"]}),(0,a.jsx)(es.F,{className:"h-48 w-full rounded-lg border bg-destructive/5 shadow-sm",children:(0,a.jsx)("pre",{className:"text-sm p-3 whitespace-pre-wrap break-all font-code",children:(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:(0,Z.c)(h.errorMessage||"No errors captured for this test.")}})})})]})]}),(0,a.jsxs)(Y,{value:"history",className:"mt-4 p-4 border rounded-lg bg-card shadow-inner",children:[(0,a.jsx)("div",{className:"flex justify-between items-center mb-3",children:(0,a.jsxs)("h3",{className:"text-lg font-semibold text-foreground flex items-center",children:[(0,a.jsx)(eb,{className:"h-5 w-5 mr-2 text-primary"}),"Individual Test Run History"]})}),p&&(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)(ee.E,{className:"h-6 w-3/4 rounded-md"}),(0,a.jsx)(ee.E,{className:"h-64 w-full rounded-lg"})]}),g&&!p&&(0,a.jsxs)(et.Fc,{variant:"destructive",className:"rounded-lg",children:[(0,a.jsx)(en.A,{className:"h-4 w-4"}),(0,a.jsx)(et.XL,{children:"Error Loading Test History"}),(0,a.jsx)(et.TN,{children:g})]}),!p&&!g&&0===m.length&&(0,a.jsxs)(et.Fc,{className:"rounded-lg",children:[(0,a.jsx)(ei.A,{className:"h-4 w-4"}),(0,a.jsx)(et.XL,{children:"No Historical Data"}),(0,a.jsxs)(et.TN,{children:["No historical run data found for this specific test (ID: ",e,")."]})]}),!p&&!g&&m.length>0&&(0,a.jsx)("div",{ref:j,className:"w-full h-[300px] bg-card p-4 rounded-lg shadow-inner",children:(0,a.jsx)(eF.u,{width:"100%",height:"100%",children:(0,a.jsxs)(eC.b,{data:m,margin:{top:5,right:20,left:-20,bottom:5},children:[(0,a.jsx)(eD.d,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),(0,a.jsx)(eL.W,{dataKey:"date",tickFormatter:e=>new Date(e).toLocaleDateString("en-CA",{month:"short",day:"numeric"}),stroke:"hsl(var(--muted-foreground))",tick:{fontSize:10},angle:-30,textAnchor:"end",height:40}),(0,a.jsx)(eP.h,{tickFormatter:e=>ez(e),stroke:"hsl(var(--muted-foreground))",tick:{fontSize:10},width:80}),(0,a.jsx)(eS.m,{content:(0,a.jsx)(e$,{})}),(0,a.jsx)(eI.s,{wrapperStyle:{fontSize:"12px"}}),(0,a.jsx)(eE.N,{type:"monotone",dataKey:"duration",name:"Duration",stroke:"hsl(var(--primary))",strokeWidth:2,dot:(0,a.jsx)(eR,{}),activeDot:{r:7}})]})})})]})]})})]})]})}},13433:(e,t,s)=>{Promise.resolve().then(s.bind(s,17947))},17947:(e,t,s)=>{"use strict";s.d(t,{TestDetailsClientPage:()=>a});let a=(0,s(12907).registerClientReference)(function(){throw Error("Attempted to call TestDetailsClientPage() from the server but TestDetailsClientPage is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/administrator/pulse-dashboard/src/components/pulse-dashboard/TestDetailsClientPage.tsx","TestDetailsClientPage")},19121:e=>{"use strict";e.exports=require("next/dist/server/app-render/action-async-storage.external.js")},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:e=>{"use strict";e.exports=require("path")},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},69258:(e,t,s)=>{"use strict";s.r(t),s.d(t,{GlobalError:()=>l.a,__next_app__:()=>h,pages:()=>c,routeModule:()=>u,tree:()=>d});var a=s(65239),r=s(48088),n=s(88170),l=s.n(n),i=s(30893),o={};for(let e in i)0>["default","tree","pages","GlobalError","__next_app__","routeModule"].indexOf(e)&&(o[e]=()=>i[e]);s.d(t,o);let d={children:["",{children:["test",{children:["[testId]",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(s.bind(s,93161)),"/Users/administrator/pulse-dashboard/src/app/test/[testId]/page.tsx"]}]},{}]},{}]},{layout:[()=>Promise.resolve().then(s.bind(s,94431)),"/Users/administrator/pulse-dashboard/src/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(s.t.bind(s,57398,23)),"next/dist/client/components/not-found-error"],forbidden:[()=>Promise.resolve().then(s.t.bind(s,89999,23)),"next/dist/client/components/forbidden-error"],unauthorized:[()=>Promise.resolve().then(s.t.bind(s,65284,23)),"next/dist/client/components/unauthorized-error"]}]}.children,c=["/Users/administrator/pulse-dashboard/src/app/test/[testId]/page.tsx"],h={require:s,loadChunk:()=>Promise.resolve()},u=new a.AppPageRouteModule({definition:{kind:r.RouteKind.APP_PAGE,page:"/test/[testId]/page",pathname:"/test/[testId]",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:d}})},79748:e=>{"use strict";e.exports=require("fs/promises")},93161:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>l,metadata:()=>n});var a=s(37413),r=s(17947);let n={title:"Test Details - Pulse Dashboard",description:"Detailed view of a specific test run."};function l({params:e}){return(0,a.jsx)(r.TestDetailsClientPage,{testId:e.testId})}}};var t=require("../../../webpack-runtime.js");t.C(e);var s=e=>t(t.s=e),a=t.X(0,[447,724,765,102,445,171],()=>s(69258));module.exports=a})();